﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_startlogin : System.Web.UI.Page
{
    Admin a = new Admin();

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void imageButton1_Click(object sender, ImageClickEventArgs e)
    {
        if (this.TextBox3.Text.ToUpper() != Session["User"].ToString().ToUpper())
        {
            Response.Write("<script>alert('验证码错误');history.go(-1);</script>");
            Response.End();
        }
        else
        {
            if (a.VerifyAdmin(this.TextBox1.Text, Function.ReturnMd5Pwd(this.TextBox2.Text)) <= 0)
            {
                Response.Write("<script>alert('用户名或密码错误,请重试...');history.go(-1);</script>");
            }
            else
            {
                Session["adminid"] = a.GetAdminByCheck(this.TextBox1.Text, Function.ReturnMd5Pwd(this.TextBox2.Text));
                Session["adminname"] = this.TextBox1.Text;
                Response.Redirect("index.aspx");
            }
        }
    }
}
